package com.bjpowernode.boss.convert;

import com.bjpowernode.boss.convert.help.CommonFun;
import com.bjpowernode.boss.dao.entity.PayProduct;
import com.bjpowernode.boss.dao.entity.PayWay;
import com.bjpowernode.boss.mvc.models.vo.product.PayProductVo;
import com.bjpowernode.boss.mvc.models.vo.way.PayWayVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = "spring",uses={CommonFun.class})
public interface PaymentConvert {


    List<PayWayVo> toListPayWayVo(List<PayWay> payWayList);

    List<PayProductVo> toListPayProductVo(List<PayProduct> productList);


    @Mappings({
            @Mapping(source="editTime",target = "editTime",dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "status",target = "status",qualifiedByName = "transPublicStatus1")
    })
    PayProductVo mapPayProductVo(PayProduct payProduct);



    @Mappings({
            @Mapping(source="editTime",target = "editTime",dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "status",target = "status",qualifiedByName = "transPublicStatus1"),
            @Mapping(source = "payProductCode",target = "productCode")
    })
    PayWayVo mapPayWayVo(PayWay payWay);
}
